shutdownRequest
Type
message
Summary
Sent to the current card of the defaultStack when the user tries to quit the application.
Syntax
shutdownRequest
Description
Handle the shutdownRequest message if you want to prevent the user from quitting the application.
If the shutdownRequest handler does not pass the message or send it to a further object in the message path, the application does not exit. Passing the message allows the application to quit.
In standalones, some care is needed to ensure you receive the shutdownRequest message if your application uses multiple stacks. The most reliable approach is to install a library stack or backscript to handle the message when your application starts up.
On OS X and Unix systems, if the operating system sends a SIGTERM signal to the application, LiveCode sends a shutdownRequest message to the current stack. Passing the message causes the application to quit normally. If the message is trapped, the signal is ignored.
Applications will not receive this message when running in the IDE.
Examples
on shutdownRequest
answer question "Are you sure you want to quit?" with "Yes" or "No"
if it is "Yes" then pass shutdownRequest
end shutdownRequest
Related
command: quit
control structure: pass
glossary: application, current card, current stack, handler, message path, pass, message, trap, object
property: defaultStack
Compatibility and Support
Introduced
LiveCode 1.0
OS
mac
windows
linux
ios
android
Platforms
desktop
server
mobile